﻿<Window x:Class="GeometryViz3D.Views.AddLineDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Add Line" 
    FocusManager.FocusedElement="{Binding ElementName=tbName}" 
    WindowStartupLocation="CenterOwner" Margin="3">
    <Window.Resources>
        <Style x:Key="labelStyle" TargetType="Label">
            <Setter Property="HorizontalAlignment" Value="Left" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>
        <Style x:Key="textBoxStyle" TargetType="TextBox">
            <Setter Property="Margin" Value="2" />
        </Style>
        <Style x:Key="comboBoxStyle" TargetType="ComboBox">
            <Setter Property="Margin" Value="2" />
        </Style>
    </Window.Resources>
    
    <DockPanel >
        <StackPanel DockPanel.Dock="Right" 
                    HorizontalAlignment="Right" 
                    MinWidth="80"
                    Margin="3">
            
            <Button Content="Add Line"
                    IsDefault="True" 
                    Margin="2"
                    Command="{Binding AddLineCommand}" />
            <Button Content="Close"
                    Margin="2"
                    IsCancel="True" />
        </StackPanel>
        <StackPanel MinWidth="160" Orientation="Vertical">
            <Label Content="Lines:" />
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition MinWidth="50" Width="50"/>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition MinHeight="27"/>
                    <RowDefinition MinHeight="27"/>
                    <RowDefinition MinHeight="27"/>
                </Grid.RowDefinitions>
                
                <Label Grid.Column="0"
                       Grid.Row="0"
                       Style="{StaticResource labelStyle}"
                       Content="Point 1:" />
                <ComboBox Grid.Column="1"
                          Grid.Row="0"
                          Style="{StaticResource comboBoxStyle}" 
                          ItemsSource="{Binding Path=Points}"
                          SelectedValue="{Binding Point1}"/>
                
                <Label Grid.Column="0"
                       Grid.Row="1"
                       Style="{StaticResource labelStyle}"
                       Content="Point 2:" />
                <ComboBox Grid.Column="1" 
                          Grid.Row="1" 
                          Style="{StaticResource comboBoxStyle}"
                          ItemsSource="{Binding Points}"
                          SelectedValue="{Binding Path=Point2}" />
                
                <Label Grid.Column="0"
                       Grid.Row="2"
                       Style="{StaticResource labelStyle}"
                       Content="Color:" />
                <ComboBox Grid.Column="1"
                          Grid.Row="2"
                          Style="{StaticResource comboBoxStyle}"
                          ItemsSource="{Binding LineColors}" 
                          SelectedValue="{Binding Color}"
                          ItemTemplate="{StaticResource colorComboBoxItemTemplate}"
                          IsSynchronizedWithCurrentItem="True" />
            </Grid>
        </StackPanel>
    </DockPanel>
</Window>
